package com.soilflow.know.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.soilflow.common.core.domain.entity.GamesInfo;
import com.soilflow.common.domain.KnowsInfo;
import com.soilflow.common.domain.dto.KnowsInfoDto;
import com.soilflow.common.domain.vo.KnowsInfoVo;
import com.soilflow.common.utils.bean.BeanUtils;
import com.soilflow.know.mapper.GamesInfoMapper;
import com.soilflow.know.mapper.KnowsInfoMapper;
import com.soilflow.know.service.GamesInfoService;
import com.soilflow.know.service.KnowsInfoService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class GamesInfoServiceImpl extends ServiceImpl<GamesInfoMapper, GamesInfo> implements GamesInfoService {

    @Override
    public GamesInfo selectGamesInfoById(Long id) {
        GamesInfo landInfoVos = this.baseMapper.selectGamesInfoById(id);
        return landInfoVos;
    }


    @Override
    public List<GamesInfo> selectGamesInfoList(GamesInfo dto) {
        List<GamesInfo> landInfoVos = this.baseMapper.selectGamesInfoList(dto);
        return landInfoVos;
    }


    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean insertGamesInfo(GamesInfo dto) {
        boolean save =false;
        GamesInfo landInfo = new GamesInfo();
        BeanUtils.copyProperties(dto,landInfo);
        save = this.save(landInfo);
        return save;
    }


    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean updateGamesInfo(GamesInfo dto) {
        boolean save =false;
        GamesInfo landInfo = new GamesInfo();
        BeanUtils.copyProperties(dto,landInfo);
        //修改百事通信息
        save = this.updateById(landInfo);
        return save;
    }

    @Override
    public Boolean deleteGamesInfoByIds(List<Long> ids) {
        return this.removeByIds(ids);
    }
}
